<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
	request.setCharacterEncoding("UTF-8");
	String htmlData = request.getParameter("content") != null ? request
			.getParameter("content") : "";
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<title>后台</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="<%=basePath%>common/default/default.css" />
<link rel="stylesheet"
	href="<%=basePath%>common/plugins/code/prettify.css" />
<script charset="utf-8" src="<%=basePath%>common/lang/kindeditor.js"></script>
<script charset="utf-8" src="<%=basePath%>common/lang/zh_CN.js"></script>
<script charset="utf-8"
	src="<%=basePath%>common/plugins/code/prettify.js"></script>
<link rel="stylesheet" href="<%=basePath%>common/default/default.css" />
<link rel="stylesheet"
	href="<%=basePath%>common/plugins/code/prettify.css" />
<link href="<%=basePath%>common/bootstrap/css/bootstrap.min.css"
	rel="stylesheet" type="text/css" />
<link href="<%=basePath%>common/ad/fonts/iconfont.css" rel="stylesheet"
	type="text/css" />
<!-- Font Awesome Icons -->
<link
	href="<%=basePath%>common/font-awesome/4.3.0/css/font-awesome.min.css"
	rel="stylesheet" type="text/css" />
<!-- Theme style -->
<link href="<%=basePath%>common/dist/css/AdminLTE.min.css"
	rel="stylesheet" type="text/css" />
<link href="<%=basePath%>common/dist/css/skins/skin-blue.min.css"
	rel="stylesheet" type="text/css" />
<link
	href="<%=basePath%>common/plugins/datatables/dataTables.bootstrap.css"
	rel="stylesheet" type="text/css" />
<link
	href="<%=basePath%>common/plugins/datetimepicker/css/bootstrap-datetimepicker.min.css"
	rel="stylesheet" type="text/css" />
<!-- jQuery 2.1.3 -->
<script src="<%=basePath%>common/plugins/jQuery/jQuery-2.1.3.min.js"></script>
<script
	src="<%=basePath%>common/plugins/datatables/jquery.dataTables.js"
	type="text/javascript"></script>
<!-- Bootstrap 3.3.2 JS -->
<script src="https://code.jquery.com/ui/1.11.1/jquery-ui.min.js"
	type="text/javascript"></script>
<script
	src="<%=basePath%>common/plugins/slimScroll/jquery.slimscroll.min.js"
	type="text/javascript"></script>
<!-- FastClick -->
<script src='<%=basePath%>common/plugins/fastclick/fastclick.min.js'></script>
<!-- AdminLTE App -->
<script src="<%=basePath%>common/dist/js/app.min.js"
	type="text/javascript"></script>
<!-- AdminLTE for demo purposes -->
<script src="<%=basePath%>common/dist/js/demo.js" type="text/javascript"></script>
<!-- Bootstrap 3.3.2 JS -->
<script src="<%=basePath%>common/bootstrap/js/bootstrap.min.js"
	type="text/javascript"></script>
<!-- jvectormap -->
<script
	src="<%=basePath%>common/plugins/jvectormap/jquery-jvectormap-1.2.2.min.js"
	type="text/javascript"></script>
<script
	src="<%=basePath%>common/plugins/jvectormap/jquery-jvectormap-world-mill-en.js"
	type="text/javascript"></script>
<!-- datepicker -->
<script
	src="<%=basePath%>common/plugins/datepicker/bootstrap-datepicker.js"
	type="text/javascript"></script>
<!-- Bootstrap WYSIHTML5 -->
<script
	src="<%=basePath%>common/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js"
	type="text/javascript"></script>
<script
	src="<%=basePath%>common/plugins/datatables/dataTables.bootstrap.js"
	type="text/javascript"></script>
<script src="<%=basePath%>common/uploadui/jquery.fileupload.js"></script>
<script
	src="<%=basePath%>common/plugins/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script
	src="<%=basePath%>common/plugins/datetimepicker/locales/bootstrap-datetimepicker.zh-CN.js"></script>
<script type="text/javascript"
	src="<%=basePath%>common/bootstrap/js/bootstrap.min.js"></script>
<script charset="utf-8" src="<%=basePath%>common/lang/kindeditor.js"></script>
<script charset="utf-8" src="<%=basePath%>common/lang/zh_CN.js"></script>
<script charset="utf-8"
	src="<%=basePath%>common/plugins/code/prettify.js"></script>
<link rel="stylesheet" href="kindeditor/themes/default/default.css" />
<link rel="stylesheet" href="kindeditor/plugins/code/prettify.css" />
<script charset="utf-8" src="kindeditor/kindeditor.js"></script>
<script charset="utf-8" src="kindeditor/lang/zh_CN.js"></script>
<script charset="utf-8" src="kindeditor/plugins/code/prettify.js"></script>
<script>
		KindEditor.ready(function(K) {
			var editor1 = K.create('textarea[name="content"]', {
				cssPath : 'kindeditor/plugins/code/prettify.css',
				uploadJson : '../kindeditor/jsp/upload_json.jsp',
				fileManagerJson : '../kindeditor/jsp/file_manager_json.jsp',
				allowFileManager : true,
				afterCreate : function() {
					var self = this;
					K.ctrl(document, 13, function() {
						self.sync();
						document.forms['example'].submit();
					});
					K.ctrl(self.edit.doc, 13, function() {
						self.sync();
						document.forms['example'].submit();
					});
				}
			});
			prettyPrint();
		});
	</script>

<script>
 
	function ischeckNum() {
		var num = document.getElementById('number').value;
		var title = document.getElementById('title').value;
		var adr = document.getElementById('adr').value;
		var scope = document.getElementById('scope').value;
		var time = document.getElementById('datetimepicker').value;
		var duty = document.getElementById('duty').value;
		var content = document.getElementById('content').value;
		
		if (title) {
			
		} else {
			alert('需输入标题');
			document.getElementById("title").focus; 
			return false;
		//	example.number.focus();
		}
		if (adr) {
			
		} else {
			alert('需输入地址');
			document.getElementById("adr").focus; 
		//	example.number.focus();
			return false;
		}
		if (scope) {
			if (isNaN(num)) {
				alert('薪资范围应是数字');
				document.getElementById("scope").focus; 
			//	example.number.select();
				return false;
			} 
		} else {
			alert('需输入薪资范围');
			document.getElementById("scope").focus; 
			return false;
		//	example.number.focus();
		}
		if (num) {
			if (isNaN(num)) {
				alert('招聘人数应是数字');
				document.getElementById("number").focus; 
			//	example.number.select();
				return false;
			} 
		} else {
			alert('需输入招聘人数');
			document.getElementById("number").focus; 
			return false;
		//	example.number.focus();
		}
		if (duty) {
			
		} else {
			alert('需输入职责');
			document.getElementById("duty").focus; 
			return false;
		//	example.number.focus();
		}
		if (content) {
			
		} else {
			alert('需输入要求');
			document.getElementById("content").focus; 
			return false;
		//	example.number.focus();
		}
		if (time) {
			
		} else {
			alert('需输入内容');
			document.getElementById("datetimepicker").focus; 
			return false;
		//	example.number.focus();
		}
	}
</script>

<!-- Main content -->
<section class="content" id="refundcontent">
<div class="row">
	<div class="col-md-12">

		<div class="box box-danger">
			<div class="box-header">

				<section class="content-header">
				<h1>
					<ol class="breadcrumb">
						<li>
							<a href="<%=basePath%>showtrans.do"><i
								class="fa fa-th-list fa-lg"></i>列表</a>
						</li>
						<li>
							添加招聘
						</li>
					</ol>
				</h1>
				</section>
			</div>
			<div class="box-body">
				<!-- phone mask -->
				<div class="form-group">

					<div class="bg-info" style="padding: 10px;">
						<p>
							<form name="example" method="post" action="../addtrans.do"
								accept-charset="UTF-8"
								onsubmit="document.charset='utf-8'; return ischeckNum()">
								标题：
								<input style="margin-right: 80px;" type="text" name="title"
									value="" id="title" />
								<input type="hidden" name="time" value="">
								<br>
								类别：
								<select name="type">
									<option value="社会招聘" selected="selected">
										社会招聘
									</option>
									<option value="校园招聘">
										校园招聘
									</option>
								</select>
								<br>
								性质：
								<select name="nature">
									<option value="全职" selected="selected">
										全职
									</option>
									<option value="兼职">
										兼职
									</option>
								</select>
								<br>
								地点：
								<input style="margin-right: 80px;" type="text" id="adr"
									name="adress" value="" />
								<br>
								薪资：
								<input id="scope" style="margin-right: 80px;" type="text"
									name="scope" value="" />
								<br>
								<br>
								招聘人数：
								<input style="margin-right: 80px;" id="number" type="text"
									name="number" value="" placeholder="请输入数字" />
								<br>
								<br>
								截止时间：
								<input style="margin-right: 80px;" type="text" name="deadtime"
									id="datetimepicker" value="" />
								<br>
								岗位职责
								<input type="text" name="duty" value="" id="duty"
									style="margin-right: 80px; width: 300px; height: 150px;" />
								<br>
								<label>
									任职要求:
								</label>
								<textarea name="content" cols="100" rows="8" id="content"
									style="width: 100%; height: 400px; visibility: hidden;"></textarea>
								<br />
								<input type="submit" name="button" value="提交内容" "/>
							</form>
						</p>
					</div>

				</div>
			</div>
		</div>
	</div>
</div>
</section>
<%!private String htmlspecialchars(String str) {
		str = str.replaceAll("&", "&amp;");
		str = str.replaceAll("<", "&lt;");
		str = str.replaceAll(">", "&gt;");
		str = str.replaceAll("\"", "&quot;");
		return str;
	}%>

<script type="text/javascript">
	$("#datetimepicker").datetimepicker( {
		language : 'zh-CN',
		minView : '2',
		format : 'yyyy-mm-dd'
	});
	
</script>
